﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL
{
    public class MessageAction
    {
        public static string Success = "success";
        public static string Fail = "fail";
        public static string CapPhep = "Cấp phép";
        public static string HuyBo = "Hủy bỏ";
        public static string DangKy = "Đăng ký";
        public static string GiaHan = "Gia hạn";

        public static bool IsNumber(string value)
        {
            // Return true if this is a number.
            int number1;
            return int.TryParse(value, out number1);
        }

        public static string FormatMoney(string money)
        {
            char[] m = money.ToCharArray();
            string format = "";
            int k=0;
            for (int i = m.Length-1; i >=0; i--)
            {
                k++;
                format += m[i];
                if (k == 3)
                {
                    format += " ";
                    k = 0;
                }
            }
            char[] m2 = format.ToCharArray();
            Array.Reverse(m2);
            return new string(m2) + " VNĐ";
        }

    }
}
